angular.module('${menuCode}')
.controller("${widgetCode}Ctrl",function($scope,AppKit){
	
	if("receive" == $scope.category){
		var url = '/portal/resource?MobileLatestMessagesDataProvider&actionType=getReceiveLatestMessage&ID='+$scope.currentId;
		var promise = AppKit.getJsonApi(url);
		promise.success(function(rspJson){
			$scope.title = rspJson.title;
			$scope.content = rspJson.content;
			$scope.createTime = rspJson.createTime;
			$scope.sender = rspJson.sender;
			$scope.receiver = rspJson.receiver;
		});
	}else if("send" == $scope.category){
		var url = '/portal/resource?MobileLatestMessagesDataProvider&actionType=getSendLatestMessage&ID='+$scope.currentId;
		var promise = AppKit.getJsonApi(url);
		promise.success(function(rspJson){
			$scope.title = rspJson.title;
			$scope.content = rspJson.content;
			$scope.createTime = rspJson.createTime;
			$scope.sender = rspJson.sender;
			$scope.receiver = rspJson.receiver;
		});
	}
});